<template>
  <div>
    <el-button
    :disabled = "disabled"
    :size = 'size'
    :style= "`${ml ? `margin-left:${ml}px` : ''}`"
    @click= "handleClickButton"
    :type = "type"
    >{{label}}</el-button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import ElConfigProvider from 'element-plus'

export default defineComponent({
  name: 'ifButton',
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    label: {
      type: String,
    },
    type: {
      type: String
    },
    size: {
      type: String,
    },
    handleClickButton: {
      type: Function || undefined
    },
    ml: {
      type: Number
    }
  },
  components: {
    [(ElConfigProvider as any).name]: ElConfigProvider,
  },
})
</script>

<style scoped lang="less">
:deep(.el-button) {
  height: 32px;
}
</style>
